package leetcode_201_300;

import node.ListNode;

import java.util.ArrayList;
import java.util.List;

public class LeeCode_234 {
    public static void main(String[] args) {

    }
    private static boolean isPalindrome(ListNode head) {
        List<ListNode> list = new ArrayList<>();
        while (head != null){
            list.add(head);
            head = head.next;
        }
        int l = 0, r = list.size() - 1;
        while (l < r){
            if (list.get(l).val != list.get(r).val)
                return false;
            l++;
            r--;
        }
        return true;
    }
}
